// 封装处理导出电费明细表格
function MakemeterEleclist(list, obj) {
let dianfeiList = [];
  list.forEach(meter => {
    console.log(meter,55555555);
    if (meter.priceSchemeType == '02' || meter.priceSchemeType == '03') {
      var childenlist = [
        {
            mingxi: '尖',
            shangqi: meter.sharpLastValue,
            benqi: meter.sharpCurrentValue,
            ct: meter.sharpCt,
            pt: meter.sharpPt,
            dianliang: meter.sharpValue,
            danjia: meter.sharpUnit,
            jine: meter.sharpAmount
        },
        {
            mingxi: '峰',
            shangqi: meter.peakLastValue,
            benqi: meter.peakCurrentValue,
            ct: meter.peakCt,
            pt: meter.peakPt,
            dianliang: meter.peakValue,
            danjia: meter.peakUnit,
            jine: meter.peakAmount
        },
        {
            mingxi: '平',
            shangqi: meter.flatLastValue,
            benqi: meter.flatCurrentValue,
            ct: meter.flatCt,
            pt: meter.flatPt,
            dianliang: meter.flatValue,
            danjia: meter.flatUnit,
            jine: meter.flatAmount
        },
        {
            mingxi: '谷',
            shangqi: meter.valleyLastValue,
            benqi: meter.valleyCurrentValue,
            ct: meter.valleyCt,
            pt: meter.valleyPt,
            dianliang: meter.valleyValue,
            danjia: meter.valleyUnit,
            jine: meter.valleyAmount
        },
        {
          mingxi: '深谷',
          shangqi: meter.deepValleyLastValue,
          benqi: meter.deepValleyCurrentValue,
          ct: meter.deepValleyCt,
          pt: meter.deepValleyPt,
          dianliang: meter.deepValleyValue,
          danjia: meter.deepValleyUnit,
          jine: meter.deepValleyAmount
      },
        {
          mingxi: '总',
          shangqi: meter.totalLastValue,
          benqi: meter.totalCurrentValue,
          ct: meter.totalCt,
          pt: meter.totalPt,
          dianliang: meter.totalValue,
          danjia: meter.totalUnit,
          jine: meter.totalAmount
      },
    ];

    } else {
      var childenlist = [
        {
          mingxi: '总',
          shangqi: meter.totalLastValue,
          benqi: meter.totalCurrentValue,
          ct: meter.totalCt,
          pt: meter.totalPt,
          dianliang: meter.totalValue,
          danjia: meter.totalUnit,
          jine: meter.totalAmount
      },
      ]
  }

    dianfeiList.push({
        date: meter.date,
        meterId: meter.meterId,
        meterName: meter.meterName,
      childenlist: childenlist,
      meterReadingCycleEndDate:meter.meterReadingCycleEndDate,
      meterReadingCycleStartDate:meter.meterReadingCycleStartDate,
      meterReadingEndDate:meter.meterReadingEndDate,
      meterReadingStartDate:meter.meterReadingStartDate,
    });
});
  return dianfeiList
}
export { MakemeterEleclist }
 
// 封装导出分摊数据表格
function  MakemeterWorterlist(list) {
  let dianfeiList = [];
    list.forEach(meter => {
        let childenlist = [
            {
                mingxi: '总',
                shangqi: meter.totalLastValue,
                benqi: meter.totalCurrentValue,
                dianliang: meter.totalValue,
                danjia: meter.totalUnit,
                jine: meter.totalAmount
            }
        ];
        dianfeiList.push({
            date: meter.date,
            meterId: meter.meterId,
            meterName: meter.meterName,
          childenlist: childenlist,
          meterReadingCycleEndDate:meter.meterReadingCycleEndDate,
          meterReadingCycleStartDate:meter.meterReadingCycleStartDate,
          meterReadingEndDate:meter.meterReadingEndDate,
          meterReadingStartDate:meter.meterReadingStartDate,
        });
    });
   return dianfeiList
}
export {MakemeterWorterlist}